Post

Replies

Boosts

Views

Activity

Reply to Get coordinates in the onLongPressGesture on the Map
Another alternative is to use the LongPressGesture in the context of a GeometryReader: import SwiftUI GeometryReader { proxy in HStack { Text("Press Me") } .onLongPress { let longBounds = proxy.frame(in: .global) let longPoint = CGPoint(x: longBounds.midX, y: longBounds.midY) // invoke a call, send the point to a publisher, or something } }
Nov ’23